package com.relytosoft.mizar.analyze.system.services.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.relytosoft.dubhe.common.core.base.page.PageQuery;
import com.relytosoft.mizar.analyze.system.api.entity.AyPersonFace;
import com.relytosoft.mizar.analyze.system.services.mapper.AyPersonFaceMapper;
import com.relytosoft.mizar.analyze.system.services.service.AyPersonFaceService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author lj
 * @date 2022/5/12 11:48
 */
@Service
public class AyPersonFaceServiceImpl extends ServiceImpl<AyPersonFaceMapper, AyPersonFace> implements AyPersonFaceService {

    @Override
    public IPage<AyPersonFace> selectAyPersonFacePageList(PageQuery pageQuery, AyPersonFace ayPersonFace) {
        return baseMapper.selectPageFaceList(pageQuery.build(), ayPersonFace);
    }

    @Override
    public List<AyPersonFace> selectAyPersonFaceList(AyPersonFace ayPersonFace) {
        return baseMapper.selectFaceList(ayPersonFace);
    }

    @Override
    public AyPersonFace selectByPersonId(Integer personId) {
        LambdaQueryWrapper<AyPersonFace> wrapper = new QueryWrapper<AyPersonFace>().lambda();
        wrapper.eq(AyPersonFace::getPersonId, personId);
        return this.getOne(wrapper);
    }
}
